import request from '@/utils/request';


// 新增菜单
export function addMenu(data) {
    return request({
        url: '/dbo/sassOperation/tenant/menu/addMenu',
        method: 'post',
        data
    })
}

// 获取菜单
export function listMenu(params){
    return request({
        url:'/dbo/sassOperation/tenant/menu/list',
        params
    })
}

// 根据菜单查询详情
export function getMenu(id){
    return request({
        url:`/dbo/sassOperation/tenant/menu/getMenuInfo/${id}`
    })
}
// 删除菜单
export function delMenu(id){
    return request({
        url:`/dbo/sassOperation/tenant/menu/delete/${id}`,
        method:'delete'
    })
}
// 修改菜单
export function updateMenu(id,data){
    return request({
        url:`/dbo/sassOperation/tenant/menu/update/${id}`,
        method:'post',
        data
    })
}
// 角色树
export function permissTree(code) {
    return request({
        url: `/dbo/sassOperation/tenant/menu/roleMenuTreeSelect/${code}`,
    })
}


// 查询角模板列表
export function getRoleList(code) {
    return request({
        url: `/dbo/roleTemplate/queryRoleListByCode/${code}`,
    })
}
// 新增角色
export function addRole(data) {
    return request({
        url: '/dbo/roleTemplate/add',
        method: 'post',
        data
    })
}

// 修改角色模板
export function editRole(id,data) {
    return request({
        url: `/dbo/roleTemplate/update/${id}`,
        method: 'post',
        data
    })
}
// 删除角色模板
export function delRole(roleTemplateId) {
    return request({
        url: `/dbo/roleTemplate/remove/${roleTemplateId}`,
        method: 'delete'
    })
}
